import express from 'express'
import bodyParser from 'body-parser'
import Config from './config/conf'
const app = express();
const stuRouter = require('./routers/student')
const errRouter = require('./routers/error')
const path = require('path')

app.engine('html', require('express-art-template'))

app.use(bodyParser.urlencoded({ extended : true }))

app.use('/public/',express.static(path.join(__dirname, './public/')))
app.use('/node_modules/',express.static(path.join(__dirname, './node_modules/')))


app.use(stuRouter)

app.use(errRouter)

app.listen(Config.PORT,_ => console.log(`Your application is running on localhost:${Config.PORT}`));
